<?php
namespace App\Query;

use App\Model\UserIntegral;

class UserIntegralQuery extends \HyperfStore\Query
{
    // 构建模型
    protected static function build()
    {
        return UserIntegral::latest();
    }

    // 渴望加载
    protected static function with()
    {
        return ['user'];
    }
    
    // 时间区间
    protected static function queryTime($model, $where)
    {
        return $model->whereBetween('created_at', $where);
    }
}